#include <stdio.h>

int main(void)
{
	int R, G, B;
	int result;

	scanf("%d %d %d", &R, &G, &B);
	result = (int)(R / 255.0 * 0x1F) << 11 | (int)(G / 255.0 * (double)0x3F) << 5 | (int)(B / 255.0 * (double)0x1F);
	printf("RGB code: %X\n", (int)result);

	return 0;
}
